Package number

Functions

Link copied to clipboard
operator fun Number.compareTo(other: Int): Int

It compares this number with the specified integer.

Link copied to clipboard
fun Int.isEven(): Boolean

It determines whether the specified integer is even.

Link copied to clipboard
fun Number.isInteger(): Boolean

It determines if a number is equivalent to mathematical integer number, a number with no fractional part. Please note that it may return false positives if the number is approximately equal to an integer.

Link copied to clipboard
fun Number.isNegative(): Boolean

It determines whether the specified number is negative.

Link copied to clipboard
fun Int.isOdd(): Boolean

It determines whether the specified integer is odd.

Link copied to clipboard
fun Number.isPositive(): Boolean

It determines whether the specified number is positive.

Link copied to clipboard
fun Int.isPrime(): Boolean

It determines whether the specified integer is a prime number.

Link copied to clipboard
fun Number.isZero(): Boolean

It determines whether the specified number has a zero value.

Link copied to clipboard
fun Int.toDigits(): List<Int>

It returns the list of digits of the specified integer in the same order as their value place representation.